<%--
  Created by IntelliJ IDEA.
  User: 30590
  User: 123456
  Date: 2024/10/23
  Time: 16:40
  To change this template use File | Settings | File Templates.
@@ -9,13 +9,13 @@
<%@page import="com.example.skycode6.dao.AdminDao" %>
<%
    request.setCharacterEncoding("UTF-8");
    String Action = request.getParameter("Action");
    String Action =request.getParameter("Action");
    if (Action !=null && Action.equals("Login")){
        String User = request.getParameter("User");
        String Pwd = request.getParameter("Pwd");
        String User =request.getParameter("User");
        String Pwd =request.getParameter("Pwd");
        AdminDao adminDao = new AdminDao();
        boolean isOK = adminDao.CheckLogin(User,Pwd);
        if (isOK){
        boolean isOK  = adminDao.CheckLogin(User,Pwd);
        if (isOK) {
            //设置缓存 将正确的账号记录到会话中
            session.setAttribute("user",User);
            out.println("<script>alert('登录成功');location.href='news.jsp'</script>");
@@ -24,29 +24,36 @@
            out.println("<script>alert('登录失败');location.href='login.jsp'</script>");
        }
    }

%>
<html>
<head>
    <title>后台登录-天码行空学习建站</title>
    <link rel="stylesheet" href="static/css/amazeui.min.css">
    <link rel="stylesheet" href="static/css/amazeui.min.css"/>
    <script src="static/js/main.js"></script>
</head>
<body style="background: url(static/img/login-bg.png)no-repeat">
<div class="header" style="text-align: center; margin-top:100px">
<!--引入背景图-->
<body style="background: url(static/img/login-bg.png) no-repeat">
<!--公司标题图片-->
<div class="header" style="text-align: center; margin-top: 100px">
    <div class="am-g">
        <img src="static/img/loginTitle.png"/>
        <img src="static/img/loginTitle.png">
    </div>
</div>
<div class="am-g" style="margin-top: 20px">
    <div class="am-u-lg-6  am-u-md-10  am-u-sm-centered" style="background: url(static/img/loginForm.png) no-repeat;height: 479px;width: 695px">
        <form action="login.jsp" method="post" class="am-form login-form" style="padding: 50px 0px 0px 120px; width: 550px" onsubmit="return LoginCheck()">
            <label for="name"> 用户名: </label>
            <input type="text" name="User" id="User" value=""><br>
            <label for="ps">密码: </label>
            <input type="password" name="Pwd" id="Pwd" value=""><br>
<!--登录框-->
<div class="am-g"style="margin-top: 20px">
    <div class="am-u-lg-6 am-u-md-10 am-u-sm-centered"
         style="background: url(static/img/loginForm.png) no-repeat;height:479px;width:695px">
        <!--登录表单-->
        <form action="login.jsp" method="post" class="am-form login-form"
              style="padding: 50px 0px 0px 120px;width:550px"
              onsubmit="return LoginCheck()">
            <label for="User">用户名:</label> <input type="text"name="User"id="User"value=""><br><label for="Pwd">密码:</label>
            <input type="password" name="Pwd"id="Pwd"value=""><br>
            <!--登录按钮-->
            <div class="am-cf">
                <input name="Action" type="hidden" value="Login">
                <input type="submit" value="登录" id="save" style="width: 100%;border-radius: 0.5em;" class="am-btn am-btn-primary am-btn-sm am-round">
                <input name="Action" type="hidden" value="Login"><input type="submit" value="登录" id="save " style="width: 100%;border-radius: 0.5em;"
            class="am-btn am-btn-primary am-btn-sm am-round">
            </div>
        </form>
    </div>